package com.hsource.doctorcenter.service.clinic.impl;

import java.util.List;

import cn.hutool.core.convert.Convert;
import com.hsource.doctorcenter.conf.dataSource.DataSourceType;
import com.hsource.doctorcenter.conf.dataSource.annotations.TargetDataSource;
import com.hsource.doctorcenter.service.clinic.IClinicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hsource.doctorcenter.mapper.ClinicMapper;
import com.hsource.doctorcenter.domain.clinic.Clinic;

/**
 * 科室信息Service业务层处理
 *
 * @author ruoyi
 * @date 2020-09-22
 */
@Service
@TargetDataSource(DataSourceType.MASTER)
public class ClinicServiceImpl implements IClinicService {

    @Autowired
    private ClinicMapper clinicMapper;

    /**
     * 查询科室信息
     *
     * @param id 科室信息ID
     * @return 科室信息
     */
    @Override
    public Clinic selectClinicById(String id) {
        return clinicMapper.selectClinicById(id);
    }

    /**
     * 查询科室信息列表
     *
     * @param clinic 科室信息
     * @return 科室信息
     */
    @Override
    public List<Clinic> selectClinicList(Clinic clinic) {
        return clinicMapper.selectClinicList(clinic);
    }

    /**
     * 新增科室信息
     *
     * @param clinic 科室信息
     * @return 结果
     */
    @Override
    public int insertClinic(Clinic clinic) {
        return clinicMapper.insertClinic(clinic);
    }

    /**
     * 修改科室信息
     *
     * @param clinic 科室信息
     * @return 结果
     */
    @Override
    public int updateClinic(Clinic clinic) {
        return clinicMapper.updateClinic(clinic);
    }

    /**
     * 删除科室信息对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteClinicByIds(String ids) {
        return clinicMapper.deleteClinicByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除科室信息信息
     *
     * @param id 科室信息ID
     * @return 结果
     */
    @Override
    public int deleteClinicById(String id) {
        return clinicMapper.deleteClinicById(id);
    }
}
